import unittest
from selenium import webdriver
from selenium.webdriver.common.by import By
import time

class Testcase_Demo(unittest.TestCase):
    def setUp(self):
        # self.driver = webdriver.Chrome()
        self.driver = webdriver.Edge()

    def tearDown(self):
        print("Successfully......")
        self.driver.quit()

    def test_01_login(self):
        self.driver.get('http://manager-health-java.itheima.net/')
        self.driver.find_element(By.NAME, "username").send_keys("demo")
        time.sleep(1)
        self.driver.find_element(By.NAME, "password").send_keys("758itheima,CN032@.20250530")
        time.sleep(1)
        self.driver.find_element(By.CLASS_NAME, "el-button").click()
        time.sleep(5)
        self.assertIn("main", self.driver.current_url)

    def test_02_login(self):
        self.driver.get('http://manager-health-java.itheima.net/')
        self.driver.find_element(By.NAME, "username").send_keys("demo1")
        time.sleep(1)
        self.driver.find_element(By.NAME, "password").send_keys("758itheima,CN032@.20250511")
        time.sleep(1)
        self.driver.find_element(By.CLASS_NAME, "el-button").click()
        time.sleep(5)
        self.assertIn("main", self.driver.current_url)

    def test_03_login(self):
        self.driver.get('http://manager-health-java.itheima.net/')
        self.driver.find_element(By.NAME, "username").send_keys("demo")
        time.sleep(1)
        self.driver.find_element(By.NAME, "password").send_keys("758itheima,CN032@.20250510")
        time.sleep(1)
        self.driver.find_element(By.CLASS_NAME, "el-button").click()
        time.sleep(5)
        self.assertIn("main", self.driver.current_url)